package com.example.demo111111.controller;


import com.example.demo111111.Result.PageResult;
import com.example.demo111111.entity.AuditMerchant;
import com.example.demo111111.entity.Merchant;
import com.example.demo111111.service.AuditMerchantService;
import com.example.demo111111.service.MerchantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/auditmerchant")
public class AuditMerchantController {

    @Autowired
    private AuditMerchantService auditMerchantService;

    @PostMapping
    public Boolean save(@RequestBody AuditMerchant auditMerchant){

        Boolean result= auditMerchantService.save(auditMerchant);
        return result;

    }

    @PutMapping
    public Boolean update(@RequestBody AuditMerchant auditMerchant){
        Boolean result= auditMerchantService.update(auditMerchant);
        return result;
    }

    @GetMapping ("/pageQuery")
    public PageResult pageQuery(AuditMerchant auditMerchant){
        PageResult pageResult= auditMerchantService.pageQuery(auditMerchant);
        return pageResult;
    }

    @DeleteMapping
    public Boolean delete(@RequestParam List<Long> ids) {
        Boolean result= auditMerchantService.deltete(ids);
        return result;
    }

}
